package smartt.styy.auth.model.jwt;

import java.io.Serializable;

/**
 * @author shangtengfei
 */
public class JWTInfo implements Serializable,IJWTInfo {
    /**
	 * 
	 */
	private static final long serialVersionUID = 6770522259533902749L;
	
	private String username;
    private String userId;
    private String nickName;
    
    private long effectiveTime;
    
    private String userTypes;

    private String telPhone;
    
    public JWTInfo(String username, String userId, String nickName,String userTypes,String telPhone) {
        this.username = username;
        this.userId = userId;
        this.nickName = nickName;
        this.userTypes = userTypes;
        this.telPhone = telPhone;
    }
    
    public JWTInfo(String username, String userId, String nickName,long effectiveTime,String userTypes,String telPhone) {
        this.username = username;
        this.userId = userId;
        this.nickName = nickName;
        this.effectiveTime = effectiveTime;
        this.userTypes = userTypes;
        this.telPhone = telPhone;
    }

    @Override
    public String getUniqueName() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public String getId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Override
    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        JWTInfo jwtInfo = (JWTInfo) o;
        return userId != null ? userId.equals(jwtInfo.userId) : jwtInfo.userId == null;

    }

    @Override
    public int hashCode() {
        int result = username != null ? username.hashCode() : 0;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        return result;
    }

	@Override
	public String getUserTypes() {
		return userTypes;
	}
	
	public void setUserTypes(String userTypes){
		this.userTypes = userTypes;
	}

	@Override
	public long getEffectiveTime() {
		return effectiveTime;
	}
	
	public void setUserTypes(long effectiveTime){
		this.effectiveTime = effectiveTime;
	}

	@Override
	public String getTelPhone() {
		return telPhone;
	}
	
	public void setTelPhone(String telPhone){
		this.telPhone = telPhone;
	}

	
}
